home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / POV-Ray 3.0.2 / src / SOURCE / LATHE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-09  |  3.2 KB  |  95 lines  |  [TEXT/CWIE]

  1. /****************************************************************************
  2. *                   lathe.h
  3. *
  4. *  This module contains all defines, typedefs, and prototypes for LATHE.C.
  5. *
  6. *  from Persistence of Vision(tm) Ray Tracer
  7. *  Copyright 1996 Persistence of Vision Team
  8. *---------------------------------------------------------------------------
  9. *  NOTICE: This source code file is provided so that users may experiment
  10. *  with enhancements to POV-Ray and to port the software to platforms other
  11. *  than those supported by the POV-Ray Team.  There are strict rules under
  12. *  which you are permitted to use this file.  The rules are in the file
  13. *  named POVLEGAL.DOC which should be distributed with this file. If
  14. *  POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  15. *  Team Coordinator by leaving a message in CompuServe's Graphics Developer's
  16. *  Forum.  The latest version of POV-Ray may be found there as well.
  17. *
  18. * This program is based on the popular DKB raytracer version 2.12.
  19. * DKBTrace was originally written by David K. Buck.
  20. * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  21. *
  22. *****************************************************************************/
  23.  
  24. #ifndef LATHE_H
  25. #define LATHE_H
  26.  
  27. #include "bcyl.h"
  28.  
  29.  
  30. /*****************************************************************************
  31. * Global preprocessor definitions
  32. ******************************************************************************/
  33.  
  34. #define LATHE_OBJECT (STURM_OK_OBJECT)
  35.  
  36. #define LINEAR_SPLINE    1
  37. #define QUADRATIC_SPLINE 2
  38. #define CUBIC_SPLINE     3
  39.  
  40. /* Generate additional lathe statistics. */
  41.  
  42. #define LATHE_EXTRA_STATS 1
  43.  
  44.  
  45.  
  46. /*****************************************************************************
  47. * Global typedefs
  48. ******************************************************************************/
  49.  
  50. typedef struct Lathe_Struct LATHE;
  51. typedef struct Lathe_Spline_Struct LATHE_SPLINE;
  52. typedef struct Lathe_Spline_Entry_Struct LATHE_SPLINE_ENTRY;
  53.  
  54. struct Lathe_Spline_Entry_Struct
  55. {
  56.   UV_VECT A, B, C, D;  /* Coefficients of segment */
  57. };
  58.  
  59. struct Lathe_Spline_Struct
  60. {
  61.   int References;             /* Count references to this structure. */
  62.   LATHE_SPLINE_ENTRY *Entry;  /* Array of spline segments.           */
  63.   BCYL *BCyl;                 /* bounding cylinder.                  */
  64. };
  65.  
  66. struct Lathe_Struct
  67. {
  68.   OBJECT_FIELDS
  69.   TRANSFORM *Trans;
  70.   int Spline_Type;          /* Spline type (linear, quadratic ...)  */
  71.   int Number;               /* Number of segments!!!                */
  72.   LATHE_SPLINE *Spline;     /* Pointer to spline array              */
  73.   DBL Height1, Height2;     /* Min./Max. height                     */
  74.   DBL Radius1, Radius2;     /* Min./Max. radius                     */
  75. };
  76.  
  77.  
  78.  
  79. /*****************************************************************************
  80. * Global variables
  81. ******************************************************************************/
  82.  
  83.  
  84.  
  85.  
  86. /*****************************************************************************
  87. * Global functions
  88. ******************************************************************************/
  89.  
  90. void  Compute_Lathe_BBox PARAMS((LATHE *Lathe));
  91. void  Compute_Lathe PARAMS((LATHE *Lathe, UV_VECT *P));
  92. LATHE *Create_Lathe PARAMS((void));
  93.  
  94. #endif
  95.